<template>
    <div id="QrCode"></div>
</template>

<script>
    import QrCode from 'qrcodejs2'

    export default {
        name: "QR-CODE",
        props: {
            value: String
        },
        data() {
            return {
                qrcode: null
            }
        },
        watch: {
            value(val) {
                this.qrcode.clear()
                this.qrcode.makeCode(val)
            }
        },
        components: {},
        mounted() {
            this.qrcode = new QrCode('QrCode', {
                text: this.value,
                width: 500,
                height: 500,
                colorDark: "#000000",
                colorLight: "#ffffff"
            })
        },
        methods: {},
    }
</script>
